#include <stdio.h>
#include <string.h>

struct BW
{
    unsigned char a : 4;
    unsigned char b : 2;
    unsigned char c : 2;

};

int main()
{
    struct  BW bw  = {0};
    bw.a = 10;
    bw.b = 5;                                               //超出部分会被舍弃
    bw.c = 3; 

    printf("sizeof(struct BW) = %d\n",sizeof(struct BW));  //打印为1
    printf("bw.a = %d\n",bw.a);                            //打印为10
    printf("bw.b = %d\n",bw.b);                            //打印为1     超出部分被舍弃
    printf("bw.c = %d\n",bw.c);                            //打印为3


    return 0;


}